/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Dialog.java
 *
 * Created on Aug 21, 2009, 11:01:46 AM
 */

package org.plotnikov.pricemaker;

import java.awt.Toolkit;
import org.plotnikov.pricemaker.panels.PriceMakerPanel;
import org.plotnikov.pricemaker.patterns.observer.PriceList;

/**
 *
 * @author alexey
 */
public class CoordinateDialog extends javax.swing.JDialog {

    /** Creates new form Dialog */
    public CoordinateDialog(java.awt.Frame parent, boolean modal, PriceList pricelist) {
        super(parent, modal);
        initComponents();
        PriceMakerPanel makerpanel = new PriceMakerPanel(pricelist);
        add(makerpanel);
        this.validate();
        this.repaint();
        setSize(475, 520);

        setLocation((int) (Toolkit.getDefaultToolkit().getScreenSize().getWidth() - getWidth()), 0);
        setVisible(true);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(org.plotnikov.pricemaker.PriceMakerApp.class).getContext().getResourceMap(CoordinateDialog.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N
        getContentPane().setLayout(new java.awt.FlowLayout());

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                CoordinateDialog dialog = new CoordinateDialog(new javax.swing.JFrame(), true, null);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
